<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function delConfirm(){
		var result = window.confirm('确认要删除该项吗？')
		return result;
	}
            
</script>
</head>
<body>

	<table border='1px' align='center' width='50%' cellpadding='0'
		cellspacing='0'>
		<tr align='center'>
			<td>编号</td>
			<td>姓名</td>
			<td>身份证号</td>
			<td>部门</td>
			<td>描述</td>
			<td>操作</td>
		</tr>
<!-- session.setAttribute("userpage", pageUnitUser); -->
		<c:forEach var="user" items="${userPage.userList }" varStatus="userstatus">
			<tr align='center'>
				<td>${userstatus.count }</td>
				<td>${user.userName }</td>
				<td>${user.idcard.idcardNo }</td>
				<td>${user.dept.deptName }</td>
				<td>${user.userDesc }</td>
				<td>
				  <a href='${pageContext.request.contextPath }/servlet/updateuserpageservlet?id=${user.userId}'>更新</a>&nbsp;&nbsp;&nbsp;&nbsp;
				  <a href='${pageContext.request.contextPath }/servlet/delectuserservlet?id=${user.userId}' onclick="return delConfirm()">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
				  <a href='${pageContext.request.contextPath }/servlet/updateuserstatusservlet?id=${user.userId}&user_status=${user.userStatus}'>
					${user.userStatus=="1"?"禁用":"启用" }</a>
				</td>
			</tr>
		</c:forEach>

		<tr>
			<td colspan='5' align='right'>共${userPage.pageNum }页&nbsp;&nbsp;&nbsp;&nbsp; <a
				href='${pageContext.request.contextPath }/servlet/showuserservlet?currentPage=1'>首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showuserservlet?currentPage=${userPage.prePage}'>上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				
				<c:forEach begin="1" end="${userPage.pageNum }" var="page" >
					<a href='${pageContext.request.contextPath }/servlet/showuserservlet?currentPage=${page}'>${page}</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</c:forEach>
				

				<a href='${pageContext.request.contextPath }/servlet/showuserservlet?currentPage=${userPage.nextPage}'>下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showuserservlet?currentPage=${userPage.pageNum }'>尾页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
	</table>



</body>
</html>